const express = require('express');
const tokenObj = require('../../util/jwt');
let myToken = new tokenObj();
let router = express.Router();
router.get('/', function (req, res, next) {
    let token = req.headers.token;
    if(!token) return res.send({errCode:99,message:"没有token可验证"});
    myToken.checkToken(token,function(flag) {
        if (!flag) { //没有登录的
            return res.send({errCode:9,message:"token过期了"})
        } else {//有token的
            res.send({errCode:0,message:"可继续操作"})
        }
    })
});
module.exports = router;


